{#样式为一行一个字段，用于添加用户等级，订单添加界面#}
{% extends 'laout.html' %}
{% block content %}
    {#novalidate 不让浏览器校验    #}
     <form method="post" novalidate>
        {% for field in form %}
            {% csrf_token %}
            <div class="form-group"  style="position: relative;margin-bottom: 25px">
                {# field.id_for_label自动获取标签的id  #}
                <label for="{{ field.id_for_label }}">
                    {#  产生标签                 #}
                    {{ field.label }}
                    {# field.help_text 自动获取标签的help_text注记  #}
                    {% if field.help_text %}
                        <span style="font-weight: 400;color: #333333;">（{{ field.help_text }}）</span>
                    {% endif %}
                </label>
                 {#  产生标签html#}
                {{ field }}
                {#  错误信息#}
                <span style="color: red;position: absolute;">{{ field.errors.0 }}</span>
            </div>
        {% endfor %}

        <button type="submit" class="btn btn-primary">保 存</button>
    </form>

{% endblock %}